<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>NodeJs | H5学习笔记</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        <meta name="author" content="逍遥派">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-expandable-chapters-interactive/expandable-chapters.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../md/node.js/nvm.html" />
    
    
    <link rel="prev" href="../../md/gitbook/plugins.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="4"
        data-chapter-title="NodeJs"
        data-filepath="md/node.js/introduce.md"
        data-basepath="../.."
        data-revision="Tue Dec 12 2017 20:20:34 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="md/html/html.html">
            
                
                    <a href="../../md/html/html.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        HTML
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="md/html/know.html">
            
                
                    <a href="../../md/html/know.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        认识页面、以及行内元素和块级元素
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="md/html/a.html">
            
                
                    <a href="../../md/html/a.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.1.</b>
                        
                        a标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="md/html/path.html">
            
                
                    <a href="../../md/html/path.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.2.</b>
                        
                        文件路径
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.3" data-path="md/html/img.html">
            
                
                    <a href="../../md/html/img.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.3.</b>
                        
                        img标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.4" data-path="md/html/area.html">
            
                
                    <a href="../../md/html/area.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.4.</b>
                        
                        锚点和热区
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.5" data-path="md/html/table.html">
            
                
                    <a href="../../md/html/table.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.5.</b>
                        
                        表格
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.6" data-path="md/html/media.html">
            
                
                    <a href="../../md/html/media.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.6.</b>
                        
                        音频与视频
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.7" data-path="md/html/list.html">
            
                
                    <a href="../../md/html/list.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.7.</b>
                        
                        列表
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.8" data-path="md/html/jframe.html">
            
                
                    <a href="../../md/html/jframe.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.8.</b>
                        
                        内嵌页面
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.9" data-path="md/html/icon.html">
            
                
                    <a href="../../md/html/icon.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.9.</b>
                        
                        网页icon
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.10" data-path="md/html/character.html">
            
                
                    <a href="../../md/html/character.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.10.</b>
                        
                        实体字符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.11" data-path="md/html/form.html">
            
                
                    <a href="../../md/html/form.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.11.</b>
                        
                        form表单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.12" data-path="md/html/input.html">
            
                
                    <a href="../../md/html/input.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.12.</b>
                        
                        input标签
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.12.1" data-path="md/html/input/radio.html">
            
                
                    <a href="../../md/html/input/radio.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.12.1.</b>
                        
                        radio
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.12.2" data-path="md/html/input/checkbox.html">
            
                
                    <a href="../../md/html/input/checkbox.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.12.2.</b>
                        
                        checkbox
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.12.3" data-path="md/html/input/select.html">
            
                
                    <a href="../../md/html/input/select.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.12.3.</b>
                        
                        select
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.12.4" data-path="md/html/input/file.html">
            
                
                    <a href="../../md/html/input/file.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.12.4.</b>
                        
                        file
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.12.5" data-path="md/html/input/textarea.html">
            
                
                    <a href="../../md/html/input/textarea.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.12.5.</b>
                        
                        textarea
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.12.6" data-path="md/html/input/button.html">
            
                
                    <a href="../../md/html/input/button.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.12.6.</b>
                        
                        button
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="md/css/css.html">
            
                
                    <a href="../../md/css/css.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        CSS
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="md/css/selector.html">
            
                
                    <a href="../../md/css/selector.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        CSS选择器
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="md/css/selector/element.html">
            
                
                    <a href="../../md/css/selector/element.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.1.</b>
                        
                        元素选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="md/css/selector/class.html">
            
                
                    <a href="../../md/css/selector/class.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.2.</b>
                        
                        类选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="md/css/selector/id.html">
            
                
                    <a href="../../md/css/selector/id.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.3.</b>
                        
                        ID选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.4" data-path="md/css/selector/descendant.html">
            
                
                    <a href="../../md/css/selector/descendant.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.4.</b>
                        
                        后代选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.5" data-path="md/css/selector/child.html">
            
                
                    <a href="../../md/css/selector/child.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.5.</b>
                        
                        子元素选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.6" data-path="md/css/selector/general.html">
            
                
                    <a href="../../md/css/selector/general.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.6.</b>
                        
                        兄弟选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.7" data-path="md/css/selector/adjacent.html">
            
                
                    <a href="../../md/css/selector/adjacent.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.7.</b>
                        
                        相邻选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.8" data-path="md/css/selector/pseudo.html">
            
                
                    <a href="../../md/css/selector/pseudo.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.8.</b>
                        
                        伪类选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.9" data-path="md/css/selector/att.html">
            
                
                    <a href="../../md/css/selector/att.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.9.</b>
                        
                        属性选择符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.10" data-path="md/css/selector/object.html">
            
                
                    <a href="../../md/css/selector/object.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.10.</b>
                        
                        伪对象选择符
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="md/gitbook/introduce.html">
            
                
                    <a href="../../md/gitbook/introduce.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        gitbook
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="md/gitbook/use.html">
            
                
                    <a href="../../md/gitbook/use.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        gitbook安装及使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="md/gitbook/mardown.html">
            
                
                    <a href="../../md/gitbook/mardown.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        Markdown编辑器语法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="md/gitbook/plugins.html">
            
                
                    <a href="../../md/gitbook/plugins.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        Markdown插件安装配置
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="4" data-path="md/node.js/introduce.html">
            
                
                    <a href="../../md/node.js/introduce.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        NodeJs
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="md/node.js/nvm.html">
            
                
                    <a href="../../md/node.js/nvm.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        nvm管理nodejs
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="md/node.js/npm.html">
            
                
                    <a href="../../md/node.js/npm.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        npm介绍及使用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >H5学习笔记</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="nodejs&#x4ECB;&#x7ECD;&#x53CA;&#x4F7F;&#x7528;">NodeJS&#x4ECB;&#x7ECD;&#x53CA;&#x4F7F;&#x7528;</h1>
<h3 id="nodejs&#x662F;&#x4E00;&#x4E2A;&#x57FA;&#x4E8E;-chrome-v8-&#x5F15;&#x64CE;&#x7684;-javascript-&#x8FD0;&#x884C;&#x73AF;&#x5883;&#x3002;">Node.js&#x662F;&#x4E00;&#x4E2A;&#x57FA;&#x4E8E; Chrome V8 &#x5F15;&#x64CE;&#x7684; JavaScript &#x8FD0;&#x884C;&#x73AF;&#x5883;&#x3002;</h3>
<h3 id="nodejs&#x4F7F;&#x7528;&#x4E86;&#x4E00;&#x4E2A;&#x4E8B;&#x4EF6;&#x9A71;&#x52A8;&#x3001;&#x975E;&#x963B;&#x585E;&#x5F0F;-io-&#x7684;&#x6A21;&#x578B;&#xFF0C;&#x4F7F;&#x5176;&#x8F7B;&#x91CF;&#x53C8;&#x9AD8;&#x6548;&#x3002;">Node.js&#x4F7F;&#x7528;&#x4E86;&#x4E00;&#x4E2A;&#x4E8B;&#x4EF6;&#x9A71;&#x52A8;&#x3001;&#x975E;&#x963B;&#x585E;&#x5F0F; I/O &#x7684;&#x6A21;&#x578B;&#xFF0C;&#x4F7F;&#x5176;&#x8F7B;&#x91CF;&#x53C8;&#x9AD8;&#x6548;&#x3002;</h3>
<h3 id="nodejs&#x7684;&#x5305;&#x7BA1;&#x7406;&#x5668;-npm&#xFF0C;&#x662F;&#x5168;&#x7403;&#x6700;&#x5927;&#x7684;&#x5F00;&#x6E90;&#x5E93;&#x751F;&#x6001;&#x7CFB;&#x7EDF;&#x3002;">Node.js&#x7684;&#x5305;&#x7BA1;&#x7406;&#x5668; npm&#xFF0C;&#x662F;&#x5168;&#x7403;&#x6700;&#x5927;&#x7684;&#x5F00;&#x6E90;&#x5E93;&#x751F;&#x6001;&#x7CFB;&#x7EDF;&#x3002;</h3>
<h3 id="nodejs-nvm-npm-cnpm&#x4ECB;&#x7ECD;">nodejs nvm npm cnpm&#x4ECB;&#x7ECD;</h3>
<table>
<thead>
<tr>
<th>&#x7C7B;&#x578B;</th>
<th>&#x63CF;&#x8FF0;</th>
</tr>
</thead>
<tbody>
<tr>
<td>nodejs</td>
<td>JavaScript&#x7684;&#x8FD0;&#x884C;&#x73AF;&#x5883;</td>
</tr>
<tr>
<td>nvm</td>
<td>&#x53EF;&#x4EE5;&#x5B9E;&#x73B0;node.js&#x7248;&#x672C;&#x7684;&#x5207;&#x6362;&#xFF0C;&#x4E0D;&#x7528;&#x6BCF;&#x6B21;&#x90FD;&#x5378;&#x8F7D;&#x5B89;&#x88C5;&#x65B0;&#x7248;&#x672C;node.js</td>
</tr>
<tr>
<td>npm</td>
<td>&#x7C7B;&#x4F3C;&#x4E8E;&#x6587;&#x4EF6;&#x7BA1;&#x7406;&#x5668;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x5B83;&#x8FDB;&#x884C;&#x4E00;&#x4E9B;&#x7A0B;&#x5E8F;&#x7684;&#x5B89;&#x88C5;</td>
</tr>
<tr>
<td>cnpm</td>
<td>&#x4E2D;&#x56FD;&#x7248;&#x7684;npm</td>
</tr>
</tbody>
</table>
<h2 id="&#x5173;&#x4E8E;&#x5305;&#x7BA1;&#x7406;&#x6587;&#x4EF6;&#x5939;&#x548C;&#x8DEF;&#x5F84;&#x7684;&#x4E00;&#x4E9B;&#x5751;">&#x5173;&#x4E8E;&#x5305;&#x7BA1;&#x7406;&#x6587;&#x4EF6;&#x5939;&#x548C;&#x8DEF;&#x5F84;&#x7684;&#x4E00;&#x4E9B;&#x5751;</h2>
<h3 id="&#x9996;&#x6B21;&#x5B89;&#x88C5;">&#x9996;&#x6B21;&#x5B89;&#x88C5;</h3>
<p>&#x5047;&#x8BBE;&#x4F60;&#x7684;&#x7535;&#x8111;&#x662F;&#x5E72;&#x5E72;&#x51C0;&#x51C0;&#x7684;&#xFF0C;&#x9996;&#x6B21;&#x5B89;&#x88C5;&#x540E;&#xFF0C;&#x5176;&#x5B9E;nodejs&#x53EA;&#x505A;&#x4E86;&#x4E00;&#x4EF6;&#x4E8B;&#x60C5;<br>&#x5B83;&#x628A;nodejs&#x7684;&#x6838;&#x5FC3;&#x6587;&#x4EF6;&#xFF0C;&#x9ED8;&#x8BA4;&#x653E;&#x5230;&#x4F60;&#x7684;&#x5B89;&#x88C5;&#x76EE;&#x5F55;&#x4E2D; &#x9ED8;&#x8BA4;&#x7684;&#x5168;&#x5C40;&#x63D2;&#x4EF6;&#x662F;&#x653E;&#x5728; c:\Users\&#x7528;&#x6237;&#x540D;\AppData\Roaming\npm\node_modules    &#x9ED8;&#x8BA4;&#x7684;&#x7F13;&#x5B58;&#x76EE;&#x5F55;&#x662F;&#x653E;&#x5728; c:\Users\&#x7528;&#x6237;&#x540D;\AppData\Roaming\npm-cache   </p>
<p>&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4E0B;&#x9762;&#x547D;&#x4EE4;&#x83B7;&#x53D6;</p>
<pre><code>npm config get prefix    #&#x83B7;&#x53D6;&#x5230;nodejs&#x7684;&#x5168;&#x5C40;&#x57FA;&#x7840;&#x76EE;&#x5F55;
npm config get cache     #&#x83B7;&#x53D6;&#x5230;nodejs&#x7684;&#x7F13;&#x5B58;&#x76EE;&#x5F55;
npm root -g              #&#x83B7;&#x53D6;&#x5230;nodejs&#x7684;&#x5168;&#x5C40;node_modules&#x76EE;&#x5F55;
</code></pre><h2 id="&#x5173;&#x4E8E;&#x5E38;&#x5E38;&#x8BF4;&#x7684;nodepath&#x73AF;&#x5883;&#x53D8;&#x91CF;">&#x5173;&#x4E8E;&#x5E38;&#x5E38;&#x8BF4;&#x7684;NODE_PATH&#x73AF;&#x5883;&#x53D8;&#x91CF;</h2>
<pre><code>&#x6211;&#x4EEC;&#x5728;&#x7F51;&#x4E0A;&#xFF0C;&#x603B;&#x662F;&#x770B;&#x5230;&#x5F88;&#x591A;&#x6559;&#x7A0B;&#x8BF4;&#x8981;&#x52A0;&#x4EC0;&#x4E48;NODE_PATH&#x73AF;&#x5883;&#x53D8;&#x91CF;&#xFF0C;&#x5176;&#x5B9E;&#x4E0D;&#x4E00;&#x5B9A;&#x9700;&#x8981;&#x7684;,&#x5B83;&#x4E3B;&#x8981;&#x662F;&#x7528;&#x5728;&#x5F15;&#x5165;&#x6A21;&#x5757;&#x65F6;&#x4F7F;&#x7528;&#xFF0C;&#x5BF9;&#x5168;&#x5C40;&#x547D;&#x4EE4;&#x884C;&#x5E76;&#x65E0;&#x5375;&#x7528;&#x3002;
NODE_PATH&#x4E2D;&#x7684;&#x8DEF;&#x5F84;&#x88AB;&#x904D;&#x5386;&#x662F;&#x53D1;&#x751F;&#x5728; &#x5F53;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x4F7F;&#x7528;&#x6216;&#x5F15;&#x5165;&#x67D0;&#x4E2A;&#x5168;&#x5C40;&#x6A21;&#x5757;&#x7684;&#x65F6;&#x5019;(&#x4E5F;&#x5C31;&#x662F;&#x5728;&#x4EE3;&#x7801;&#x4E2D;&#x4F7F;&#x7528;require&#x7684;&#x65F6;&#x5019;)&#xFF0C;&#x5B83;&#x4F1A;&#x5148;&#x4ECE;&#x9879;&#x76EE;&#x7684;&#x6839;&#x4F4D;&#x7F6E;&#x9012;&#x5F52;&#x641C;&#x5BFB; node_modules &#x76EE;&#x5F55;&#xFF0C;
&#x76F4;&#x5230;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x6839;&#x76EE;&#x5F55;&#x7684; node_modules&#xFF0C;&#x5982;&#x679C;&#x8FD8;&#x6CA1;&#x6709;&#x67E5;&#x627E;&#x5230;&#x6307;&#x5B9A;&#x6A21;&#x5757;&#x7684;&#x8BDD;&#xFF0C;&#x5C31;&#x4F1A;&#x53BB; NODE_PATH&#x4E2D;&#x6CE8;&#x518C;&#x7684;&#x8DEF;&#x5F84;&#x4E2D;&#x67E5;&#x627E;&#x3002;
&#x6240;&#x4EE5;&#xFF0C;&#x901A;&#x5E38;&#x54B1;&#x4EEC;&#x53EA;&#x9700;&#x8981;&#x628A;NODE_PATH&#x8BBE;&#x7F6E;&#x4E3A;&#x4F60;&#x7684;&#x5168;&#x5C40;node_modules&#x6587;&#x4EF6;&#x5939;&#x8DEF;&#x5F84;&#x5373;&#x53EF;&#x3002;
</code></pre><h2 id="&#x5982;&#x679C;&#x60F3;&#x4FEE;&#x6539;&#x4E0A;&#x9762;&#x6240;&#x8BF4;&#x8DEF;&#x5F84;">&#x5982;&#x679C;&#x60F3;&#x4FEE;&#x6539;&#x4E0A;&#x9762;&#x6240;&#x8BF4;&#x8DEF;&#x5F84;</h2>
<p>&#x9996;&#x5148;&#x6539;&#x914D;&#x7F6E;</p>
<pre><code>npm config set prefix &quot;c:\nodejs\node_global&quot;   #&#x8BBE;&#x7F6E;&#x5230;nodejs&#x7684;&#x5168;&#x5C40;&#x57FA;&#x7840;&#x76EE;&#x5F55;
npm config set cache  &quot;c:\nodejs\node_cache&quot;    #&#x8BBE;&#x7F6E;&#x5230;nodejs&#x7684;&#x7F13;&#x5B58;&#x76EE;&#x5F55;
</code></pre><p>&#x7136;&#x540E;&#x6DFB;&#x52A0;&#x65B0;&#x7684;&#x8DEF;&#x5F84;c:\nodejs\node_global\node_modules&#x5230;&#x73AF;&#x5883;&#x53D8;&#x91CF;PATH&#x4E2D;</p>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../md/gitbook/plugins.html" class="navigation navigation-prev " aria-label="Previous page: Markdown插件安装配置"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../md/node.js/nvm.html" class="navigation navigation-next " aria-label="Next page: nvm管理nodejs"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-expandable-chapters-interactive/expandable-chapters.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"expandable-chapters-interactive":{},"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
